package com.mes.control.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.text.SimpleDateFormat;
import java.util.Date;


/**
 * Created by leden on 2017/12/4.
 */
public class SalseOrderNumUntil {
    protected Logger log = LoggerFactory.getLogger(getClass());

    public static String getOrderNum(Date date,int count){
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        String dateStr=null;
        if(!date.equals("")) {
            dateStr = formatter.format(date);
        }
       dateStr= dateStr.substring(2,4);
        String unit=String.valueOf(count);
        String result="";
        int x = unit.length();
        if(x<5){
            for (int i=0;i<5-x;i++){
                result +="0";
            }
        }

       return dateStr+result+unit;

    }

    public static void main(String[] args) {
         Date date = new Date();
        String orderNum= getOrderNum(date,99999);
        String cc=orderNum;
        // String time =dateFormat(date);
        //  String time=dateFormat("017");
        // twoYear(time);
        // towMonth(time);
        // towDay(time);
        // threeDay(time);
        // stringToAscii("lele");
        //  strCut("789456123",2,4);
        //strCut("789456123",-4,4);
        //strCut("789654123",-4);
        // toHex(1821);
        // toHex(789654123L);
        //leftCut("1234");
        //rightCut("1234");

    }
}
